package com.example.treasure_back.controller;

import com.example.treasure_back.entity.MsgEntity;
import com.example.treasure_back.model.QuestionModel;
import com.example.treasure_back.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/treasure/question")
public class QuestionController {

    @Autowired
    private QuestionService questionService;

    @RequestMapping("/getQuestion/{id}")
    public MsgEntity getQuestion(@PathVariable Integer id){
        QuestionModel question = questionService.getQuestion(id);
        return new MsgEntity("SUCCESS", "200", question);
    }
}
